%%%-------------------------------------------------------------------
%%% @author mirahs(2892727493@qq.com)
%%% @doc
%%%     协议映射
%%% @end
%%%-------------------------------------------------------------------
-module(mapping).

-export([
    module/2
]).


%% 返回: {ok, NeedAuth, Caller, Proto, ModName} | {ok, Proto, ModName} | {error, Reason}
%% NeedAuth: 是否需要验证
%% Caller: 调用发起者(connector: 链接器|object:具体对象)
module(Type, Cmd) ->
    code(Type, Cmd div 1000).

%% 游戏服务器
code(game_server, 1) -> {ok, true, object, pb_system, system_rpc};
code(game_server, 2) -> {ok, false, connector, pb_account, account_rpc};
code(game_server, 3) -> {ok, true, object, pb_role, role_rpc};

%% 测试器
code(tester, 1) -> {ok, pb_system, rt_system};
code(tester, 2) -> {ok, pb_account, rt_account};
code(tester, 3) -> {ok, pb_role, rt_role};


code(Type, Code) ->
    {error, {Type, Code}}.
